package com.itheima.service;

import com.itheima.pojo.Menu;
import com.itheima.pojo.Permission;

import java.util.List;
import java.util.Map;

/**
 * @author Tony
 * @create 2021-12-07 20:44
 */
public interface PermissionService1 {

    /**
     * 查询权限
     *
     * @return the list
     */
    List<Map<String,Object>> findAllPermission();

    /**
     * 为角色添加权限
     *
     * @param permissionIds the permission
     * @param roleId the roleId
     */
    void addForRole(Integer roleId, Integer[] permissionIds);

    /**
     * 根据角色id获取权限id
     *
     * @param roleId the role id
     * @return the integer [ ]
     */
    Integer[] findPermissionIdByRoleId(Integer roleId);

    /**
     * 根据角色id删除权限中间表
     * @param roleId
     */
    void deleteRoleAndPermissionById(Integer roleId);

    /**
     * 根据角色id删除权限
     *
     * @param roleId the role id
     */
    void deletePermissionById(Integer roleId);

    /**
     * Add permission byid.
     *
     * @param permissionId1 the permission id 1
     * @param roleId        the role id
     */
    void addPermissionById(Integer permissionId1, Integer roleId);
}
